/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.urbainski.estagio.entidade;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Cristian Elder Urbainski
 * @since 11/12/2011
 */
@Entity
@Table(name = "turmamateria")
public class Turmamateria implements Serializable {
   
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id_turmamateria")
    private Integer idTurmamateria;
    
    @Column(name = "id_turma")
    private Integer idTurma;
    
    @Column(name = "id_materia")
    private Integer idMateria;
    
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    @JoinColumn(name = "id_materia", referencedColumnName = "id_materia", insertable = false, updatable= false)
    private Materia materia;
    
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    @JoinColumn(name = "id_turma", referencedColumnName = "id_turma", insertable = false, updatable= false)
    private Turma turma;

    public Integer getIdMateria() {
        return idMateria;
    }

    public void setIdMateria(Integer idMateria) {
        this.idMateria = idMateria;
    }

    public Integer getIdTurma() {
        return idTurma;
    }

    public void setIdTurma(Integer idTurma) {
        this.idTurma = idTurma;
    }

    public Integer getIdTurmamateria() {
        return idTurmamateria;
    }

    public void setIdTurmamateria(Integer idTurmamateria) {
        this.idTurmamateria = idTurmamateria;
    }

    public Materia getMateria() {
        return materia;
    }

    public void setMateria(Materia materia) {
        this.materia = materia;
    }

    public Turma getTurma() {
        return turma;
    }

    public void setTurma(Turma turma) {
        this.turma = turma;
    }

}
